<div id="content_con">
	<?php
		$modul = "$_GET[modul]";
		if($modul == ''){
			$modul = "home";
		}else{
			$modul = "$_GET[modul]";
		}
		if($modul == 'home'){
		$lat1 = $lat/$divider;
		$lon1 = $lon/$divider;
		$rs = mysql_query("select id_rs, nama_rs, kelas, alamat, telp, website, (6371 * 2 * atan2(sqrt((sin(((latitude/$divider) - ($lat1))/2) * sin(((latitude/$divider) - ($lat1))/2)) + cos($lat1) * cos(latitude/$divider) * sin(((longitude/$divider) - ($lon1))/2) * sin(((longitude/$divider) - ($lon1))/2)), sqrt(1 - ((sin(((latitude/$divider) - ($lat1))/2) * sin(((latitude/$divider) - ($lat1))/2)) + cos($lat1) * cos(latitude/$divider) * sin(((longitude/$divider) - ($lon1))/2) * sin(((longitude/$divider) - ($lon1))/2))))) as jarak, (select count(id_ruang) from ruang where id_rs = rs.id_rs and status = 'N') as jml from rumah_sakit rs order by jarak");
		while($r = mysql_fetch_array($rs)){
			if($r['jml'] != 0){
				echo "<div id=box_a>
						<div id=box_aa>
							<span class=box_aab>
								<span  class=box_isi>
									<table style='font-size: 12px; font-family: Arial;' width=100%>
										<tr>
											<td colspan=2><span  class=box_judul>$r[nama_rs]</span></td>
											<td colspan=2>
												<img src='asset/images/askes.png' height=14 title='Askes'>
												<img src='asset/images/jamkesmas.png' height=14 title='Jamkesmas'>
												<img src='asset/images/kjs.png' height=14 title='Kartu Jakarta Sehat'>
											</td>
										</tr>
										<tr>
											<td>$r[alamat]</td>
											<td width=15></td>
											<td width=35 >Telp. </td>
											<td width=90 ><b>$r[telp]</b></td>
										</tr>
									</table>
								</span>
							</span>
						</div>
						<div id=box_ab>
							<ul>
								<li>
									<span class=kelas>R. KOSONG</span>
								</li>";
								$ruang = mysql_query("select * from jenis_ruang");
								while($rg = mysql_fetch_array($ruang)){
								$id = $rg['id_jenis'];
								$jr[$id] = mysql_num_rows(mysql_query("select id_ruang from ruang where id_rs = $r[id_rs] and id_jenis = $id and status = 'N'"));
								echo "<li>
										<span class=kelas>$rg[jns_ruang] :</span> <span class=kamar>$jr[$id]</span>
									</li>";
								}
						echo "</ul> 
						</div>
					</div>";
				}
			}
		}else if($modul == 'map'){
			echo "<img src='asset/images/peta.png' width='700' style='border: 2px solid #ccc;'>";
		}else if($modul == 'directory'){
		
		}else{
			echo "Modul tidak ditemukan..!";
		}
	?>
</div>
<div class="clear"></div>